package com.lemontree.spring.aop;

import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class ThrowingAopTest {

    @AfterThrowing(value = "execution(* com.lemontree..*(..))",throwing = "nulEx")
    public void haveException(NullPointerException nulEx){
        System.out.println("-----------NullPointerException()--------");
        System.out.println("msg: "+nulEx.getMessage());
        System.out.println("-----------NullPointerException()--------");
    }
}
